home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 52
/
Volume 52 - JOGO DISK .iso
/
Games
/
skipandgouls.swf
/
scripts
/
__Packages
/
characters
/
VampiRay.as
< prev
Wrap
Text File
|
2007-10-01
|
1KB
|
37 lines
class characters.VampiRay extends sarbakan.visual.element.DynamicElement
{
static var ATTACK_DELAY = 200;
var nAttackDelayCount = 0;
function VampiRay(l_oLayer, l_oInfos)
{
super("vampiRay" + sarbakan.visual.element.BaseElement.getNextID());
var _loc3_ = l_oLayer.mc;
this.mc = _loc3_.attachMovie("vampiRay","vampiRay" + sarbakan.visual.element.BaseElement.nNextID,maze.MazeData.DEPTH_VAMPIRAY + sarbakan.visual.element.BaseElement.nNextID);
this.mc._x = l_oInfos.x * maze.MazeData.VIEW_TILE_WIDTH;
this.mc._y = l_oInfos.y * maze.MazeData.VIEW_TILE_HEIGHT;
this.disable();
this.updateState();
}
function idle()
{
if(this.nAttackDelayCount < characters.VampiRay.ATTACK_DELAY)
{
this.nAttackDelayCount = this.nAttackDelayCount + 1;
}
else if(this.oOwner.oDynamicElements.spongebob.bCanBeScared && this.collideWithElementBox("spongebob",this.mc.collider))
{
this.oOwner.oDynamicElements.spongebob.onScared();
this.nAttackDelayCount = 0;
this.setState("attack");
sarbakan.sound.SoundManager.play("vampiraySound",maze.MazeData.VOLUME_VAMPIRAY,1,false);
}
}
function attack()
{
if(this.stateFinished())
{
this.setState("idle");
}
}
}